#!/usr/bin/env python
#
'''
Created on 2009-3-25

@author: Wang_Yuan
'''

import wx
from ExamSettingConfirmPanel_xrc import *

class ExamSettingConfirmPanel(xrcExamSettingConfirmPanel):
    '''
    Exam Setting Confirm Panel
    '''


    def __init__(self, parent):
        '''
        Constructor
        '''
        xrcExamSettingConfirmPanel.__init__(self, parent)
        self.qTypes = [
                  'Meanings -> Word', 
                  'Example -> Word', 
                  'Word -> Meanings', 
                  ]
        self.questionTypeList.Set(self.qTypes)
        self.Refresh()
        
    def setSettings(self, settings):
        self.settings = settings
        for i in xrange(len(self.qTypes)):
            self.questionTypeList.Check(i, False)
        for i in settings.getQTypeIndexes():
            self.questionTypeList.Check(i)
        self.questionAmount.ChangeValue(unicode(settings.qAmount))
        self.Refresh()
        
def getExamSettingConfirmPanelBuilder():
    def getExamSettingConfirmPanel(parent):
        return ExamSettingConfirmPanel(parent)
    
    return getExamSettingConfirmPanel

